package demo2;
public class Animal {
    public int age;
    public String name;
    public String gender;
    public static String home;

    {
        this.age = 0;
        this.gender = "雌";
        this.name = "_";
        System.out.println("调用Animal实例化代码块！");
    }
    static {
        home = "我家";
        System.out.println("调用Animal静态代码块！");
    }

    public Animal(int age, String name, String gender) {
        this.age = age;
        this.name = name;
        this.gender = gender;
        System.out.println("调用Animal含参构造方法！");
    }
    public Animal() {
        System.out.println("调用Animal无参构造方法！");
    }
    public void func() {
        System.out.println("能干……");
    }
}
